package com.xdhl.fu.system.api;

import com.xdhl.fu.common.core.constant.SecurityConstants;
import com.xdhl.fu.common.core.constant.ServiceNameConstants;
import com.xdhl.fu.common.core.domain.R;
import com.xdhl.fu.system.api.factory.RemoteConfigFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * 系统配置远程服务
 *
 * @author 朱力维
 * @time 2022/6/2 13:13
 */
@FeignClient(contextId = "remoteConfigService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteConfigFallbackFactory.class)
public interface RemoteConfigService {

    @GetMapping(value = "/config/config-key/{configKey}")
    public R<String> getConfigByKey(@PathVariable("configKey") String configKey, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
